<template>
  <div>
    <!-- <Map></Map> -->
    <el-container>
      <el-aside width="200px">
        <div class="title">一张网调度</div>
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
        >
          <el-menu-item
            v-for="(item, index) in routes"
            :key="index"
            :index="index"
          >
            <i class="el-icon-document"></i>
            <router-link class="custom-link" :to="item.path">
              {{ item.name }}
            </router-link>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <div class="topBox"></div>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import { routes } from '../router/router'
// import Map from './Map/Map.vue'
export default {
  // components: {
  //   Map,
  // },
  data() {
    return {
      routes,
      activeIndex: '1',
      activeIndex2: '1',
    }
  },
  created() {
    console.log(this.routes, 'router')
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath)
    },
  },
}
</script>

<style scoped>
.title {
  position: relative;
  /* top: 20px; */
  font-weight: 600;
  left: 0px;
  width: 200px;
  height: 30px;
  /* text-align: center; */
  display: flex;
  align-items: center;
}
.topBox {
  width: 100%;
  /* height: 50px; */
}
.custom-link {
  /* 添加自定义样式 */
  text-decoration: none;
  color: #000;
}
.custom-link :hover {
  /* 添加自定义样式 */
  text-decoration: none;
  font-weight: 600;
  color: #15c8e3;
}
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 60px;
}

.el-aside {
  /* background-color: #d3dce6; */
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 200px;
}

/* .el-main {
  color: var(--el-text-color-primary);
  text-align: center;
  line-height: 160px;
  height: 100%;
} */

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
